package Itertator;

import java.util.*;

public class Test_Student_Iterator {
    public static void main(String[] args) {
        Collection<Student> collection = new ArrayList<Student>();
        Student st =new Student(2020,90, "yang", "big data1");
        Student st1 =new Student(2021,91, "xue", "big data1");
        Student st2 =new Student(2022,92, "xiao", "big data2");

        collection.add(st);
        collection.add(st1);
        collection.add(st2);


        Iterator<Student> iterator =collection.iterator();

        for (Student x:collection){
//            System.out.println(x);
            if(x.class_ == "big data1"){
                x.score+=10;
            }else {
                System.out.println("big data2不能加分");
            }
            if(x.score > 100){
                x.score =100;
                System.out.println("最后成绩不能超100");
            }
            System.out.println(x);
            System.out.println();
        }


    }
}
